import unittest
import string_operations as str_op

class TestStringOperations(unittest.TestCase):
    def testNotCommon(self):
        #"too" is a common word
        x = str_op.notCommon("too")
        self.assertEqual(x,False)
    
    def testNotPunct(self):
        #"5" is not a punctuation
        x = str_op.notPunct("5")
        self.assertEqual(x, True)
    
        x = str_op.notPunct(".")
        self.assertEqual(x, False)
    
    def testRemovePunct(self):
        x = str_op.removePunct("james's project.")
        self.assertEqual(x, "jamess project")
    
    def testGetStem(self):
        x = str_op.getStem("mating")
        self.assertEqual(x, "mate") 
    
    def testFormatString(self):
        x = str_op.formatString("mating partners.")
        self.assertEqual(x, ['mating', 'partners'])
        
        x = str_op.formatString("amazing 'graces'")
        self.assertEqual(x, ['amazing', 'graces'])
        
        x = str_op.formatString("too =spectators")
        self.assertEqual(x, ['spectators'])
        
    def testParseString(self):
        x = str_op.parseString("mating partners.")
        self.assertEqual(x, ['mate', 'partner']) 
        
        x = str_op.parseString("amazing 'graces'")
        self.assertEqual(x, ['amaz', 'grace'])
        
        x = str_op.parseString('too =spectators')
        self.assertEqual(x, ['spectat'])
    
    def removeUnwanted(self):
        x = str_op.removeUnwanted    
        
if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(TestStringOperations)
    unittest.TextTestRunner(verbosity=2).run(suite)